package chapter_3.demo7;

/**
 * @author: hero生仔
 */
public class Orange extends Fruit{
    private Integer weight;
    private String color;

    public Orange() {}

    public Orange(Integer weight) {
        this.weight = weight;
    }


    public Orange(String color, Integer weight) {
        this.weight = weight;
        this.color = color;
    }

//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null || getClass() != o.getClass()) return false;
//        Apple apple = (Apple) o;
//        return Objects.equals(weight, apple.weight);
//    }
//
//    @Override
//    public int hashCode() {
//        return Objects.hash(weight);
//    }


    @Override
    public String toString() {
        return "Orange{" +
                "weight=" + weight +
                '}';
    }
}
